package com.mall.app.bean;

import java.io.Serializable;
import java.time.LocalDateTime;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableLogic;
import com.baomidou.mybatisplus.extension.activerecord.Model;
import com.mall.app.utils.MyAccount;
import com.mall.app.utils.enumeration.LoginType;

import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;

/**
 * <p>
 * 买家表
 * </p>
 *
 * @author LeeSin
 * @since 2020-07-10
 */
@ApiModel(value="TbBuyer对象", description="买家表")
public class TbBuyer extends Model<TbBuyer> implements MyAccount{

    private static final long serialVersionUID = 1L;

    @ApiModelProperty(value = "买家id")
    @TableId(value = "bid", type = IdType.AUTO)
    private Integer bid;

    @ApiModelProperty(value = "买家名")
    private String bname;

    @ApiModelProperty(value = "买家性别")
    private String sex;

    @ApiModelProperty(value = "买家年龄")
    private Integer age;

    @ApiModelProperty(value = "买家电话")
    private String tel;

    @ApiModelProperty(value = "买家邮箱")
    private String email;

    @ApiModelProperty(value = "买家地址")
    private String address;

    @ApiModelProperty(value = "买家状态")
    private Integer stat;
    @TableLogic
    private Integer deleted;

    private LocalDateTime createTime;

    private LocalDateTime modifyTime;

    @ApiModelProperty(value = "买家密码")
    private String password;


    public Integer getBid() {
        return bid;
    }

    public void setBid(Integer bid) {
        this.bid = bid;
    }

    public String getBname() {
        return bname;
    }

    public void setBname(String bname) {
        this.bname = bname;
    }

    public String getSex() {
        return sex;
    }

    public void setSex(String sex) {
        this.sex = sex;
    }

    public Integer getAge() {
        return age;
    }

    public void setAge(Integer age) {
        this.age = age;
    }

    public String getTel() {
        return tel;
    }

    public void setTel(String tel) {
        this.tel = tel;
    }

    public String getEmail() {
        return email;
    }

    public void setEmail(String email) {
        this.email = email;
    }

    public String getAddress() {
        return address;
    }

    public void setAddress(String address) {
        this.address = address;
    }

    public Integer getStat() {
        return stat;
    }

    public void setStat(Integer stat) {
        this.stat = stat;
    }

    public Integer getDeleted() {
        return deleted;
    }

    public void setDeleted(Integer deleted) {
        this.deleted = deleted;
    }

    public LocalDateTime getCreateTime() {
        return createTime;
    }

    public void setCreateTime(LocalDateTime createdTime) {
        this.createTime = createdTime;
    }

    public LocalDateTime getModifyTime() {
        return modifyTime;
    }

    public void setModifyTime(LocalDateTime modifyTime) {
        this.modifyTime = modifyTime;
    }

    public String getPassword() {
        return password;
    }

    public void setPassword(String password) {
        this.password = password;
    }

    @Override
    protected Serializable pkVal() {
        return this.bid;
    }

    @Override
    public String toString() {
        return "TbBuyer{" +
        "bid=" + bid +
        ", bname=" + bname +
        ", sex=" + sex +
        ", age=" + age +
        ", tel=" + tel +
        ", email=" + email +
        ", address=" + address +
        ", stat=" + stat +
        ", deleted=" + deleted +
        ", createdTime=" + createTime +
        ", modifyTime=" + modifyTime +
        ", password=" + password +
        "}";
    }

	@Override
	public LoginType getLoginType() {
		return LoginType.BUYER;
	}

	@Override
	public String getUsername() {
		return getBname();
	}
	@Override
	public Integer getId(){
		return getBid();
	}
}
